﻿@using Smartstore.Web.Models.Catalog;

@model ProductEmailAFriendModel
 
@{
    Assets.AppendTitleParts(Model.ProductName);
    Assets.AppendMetaDescriptionParts(T("PageTitle.ProductEmailAFriend"));
    Assets.AddMetaRobots();
}

<div class="page email-a-friend-page">
    <div class="page-title">
        <h1>@T("Products.EmailAFriend.Title")</h1>
    </div>

    <div sm-if="WorkContext.CurrentCustomer.IsGuest() && !Model.AllowChangedCustomerEmail" class="alert alert-danger mb-4">
        @Html.Raw(T("Products.EmailAFriend.LoginNote", Url.RouteUrl("Login", new { returnUrl = Context.Request.RawUrl() })))
    </div>

    <div class="page-body">
        <form asp-action="EmailAFriend" class="form-horizontal" method="post">
            <fieldset>
                <legend>
                    <a asp-route="Product" asp-route-SeName="@Model.ProductSeName" sm-language-attributes-for="Model.ProductName" class="product">@Model.ProductName</a>
                </legend>

                <div asp-validation-summary="ModelOnly" class="message-error"></div>

                <div class="form-group">
                    <label asp-for="FriendEmail" class="col-form-label required"></label>
                    <input asp-for="FriendEmail" 
                           type="email" 
                           sm-required="true" 
                           autocomplete="email"
                           placeholder="@T("Products.EmailAFriend.FriendEmail.Hint")" 
                           class="fullname" />
                    <span asp-validation-for="FriendEmail"></span>
                </div>

                <div class="form-group">
                    <label asp-for="YourEmailAddress" class="col-form-label required"></label>
                    <input asp-for="YourEmailAddress" 
                           type="email" 
                           sm-required="true" 
                           autocomplete="email"
                           attr-readonly='(Model.AllowChangedCustomerEmail, "readonly")' 
                           placeholder="@T("Products.EmailAFriend.YourEmailAddress.Hint")" 
                           class="fullname" />
                    <span asp-validation-for="YourEmailAddress"></span>
                </div>

                <div class="form-group">
                    <label asp-for="PersonalMessage" class="col-form-label"></label>
                    <textarea asp-for="PersonalMessage" placeholder="@T("Products.EmailAFriend.PersonalMessage.Hint")" class="personal-message"></textarea>
                    <span asp-validation-for="PersonalMessage"></span>
                </div>

                <div class="form-group">
                    <div class="col-12 text-muted">
                        @T("Common.FormFields.Required.Hint")
                    </div>
                </div>

                <zone name="gdpr_consent" />

                <captcha sm-target="ShareProduct" class="form-group" />

                <div class="form-group">
                    <button type="submit" name="send-email" class="btn btn-primary send-email-a-friend-button">
                        <i class="fa fa-envelope" aria-hidden="true"></i>
                        <span>@T("Products.EmailAFriend.Button")</span>
                    </button>
                </div>
            </fieldset>
        </form>

        <zone name="send_email_a_friend_after" />
    </div>
</div>